import React from 'react'
import ReactDOM from 'react-dom'

import App from './App.jsx'


import store from './store'





function render () {


    ReactDOM.render(<App

        count={store.getState()}
        addCount={() => store.dispatch({ type: 'add', payload: 12 })}
        subCount={() => store.dispatch({ type: 'sub', payload: 1 })}

    />, document.getElementById('root'))


}

render()


store.subscribe(() => {
    render()
})